home *** CD-ROM | disk | FTP | other *** search
- type
- TPStringBin=class(TComponent)
- private
- fString: PString;
- protected
- procedure SetString(const Value: String);
- function GetString:String;
- public
- constructor Create(aOwner: TComponent); override;
- destructor Destroy; overide
- published
- aString: String read GetString write SetString;
- end;
-
-
- implementation
-
- {no code required for TStringBin}
-
- constructor TPStringBin.Create(aOwner:TComponent);
- begin
- inherited Create; {gosub}
- fString:=NullStr; {prepare the PString}
- end;
-
- destructor TPStringBin.Destroy;
- begin
- DisposeStr(fString); {free the PString}
- inherited Destroy; {gosub}
- end;
-
- procedure SetString(const Value: String);
- begin
- AssignStr(fString,Value); {free old and store new}
- end;
-
- function GetString:String;
- begin
- Result:=fString^; {fString is a pointer. '^' points to the string}
- end;